package designpattern.composite;

public class Duck  implements Animal {
    String name;

    public Duck(String name) {
        this.name = name;
    }

    @Override
    public void eat() {
        System.out.println("鸭 :"+name+" 吃东西");
    }

    @Override
    public void add(Animal animal) {
        //叶子对象，不实现该方法
    }

}
